import React, { Component } from 'react';
import Store from './Store';
import { observer } from 'mobx-react';
@observer
class SimpleCalculator extends Component {
  increment() {
    Store.incrementAction();
  }
  decrement() {
    Store.decrementAction();
  }
  render() {
    return (
      <fieldset>
        <legend>计算器</legend>
        <p>{Store.msg}</p>
        <button onClick={this.decrement.bind(this)}>-</button>
        <b style={{ margin: '50px' }}>{Store.num}</b>
        <button onClick={this.increment.bind(this)}>+</button>
      </fieldset>
    );
  }
}

export default SimpleCalculator;
